/*
 * @Author: spring
 * @version: 
 * @Date: 2022-09-13 08:27:04
 * @LastEditors: spring
 * @LastEditTime: 2022-09-17 18:01:27
 * @Descripttion: 
 */
#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QDial>
#include <QTcpSocket>
#include <QLineEdit>

#include "tcp_client.h"
#include "packag.h"

#include "Com_format.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT


public:
    Widget(int width,int height,QWidget *parent = nullptr);
    ~Widget();
public slots:
    void lianjietcp();
    void readcamdata();
    void changeway(int);
    void gocar();
    void stopcar();
    void buzz_on();
    void buzz_off();

private:
    int width,height;
    Ui::Widget *ui;
    QLabel *camlb,*backlb;
    QPushButton *buzzpb,*gopb,*lianjie;
    QDial *dial;
    QTcpSocket sock;
    QLineEdit *iple,*portle;
    QWidget *widget1;
    char *read_cmd=nullptr;
    char *car_cmd=nullptr;
    char *buzz_cmd=nullptr;
    trumpet *buzz_data=nullptr;
    activate_car *car_data=nullptr;
};
#endif // WIDGET_H
